﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
namespace RhinoMockStudy.Test.RhinoMockTest
{
    [TestFixture]
   public class UserBuyProductServiceTest
    {
        [Test]
        public void userBuyProductAndMoneyReduce()
        {
            var p = new Product();
            var preBuyAmount=p.TotalAmount;


            var s = new UserBuyProductService();
            var preBuyMoney=s.Customer.TotalMoney;
            int quality = 10;


            s.Buy(p, quality);

            Assert.AreEqual(preBuyAmount - quality, p.TotalAmount);
            Assert.AreEqual(preBuyMoney - quality * p.Price, s.Customer.TotalMoney);
        }


    }
}
